const mongoose = require('mongoose');
const AdminModel = require('./AdminModel');
const ArticleSchmea = mongoose.Schema({
    article_id: { //当前文章发表id
        type: mongoose.Schema.Types.ObjectId,
        ref: AdminModel
    },
    u_id: { //当前用户发表id
        type: String
    },
    username: { //当前用户发表名称
        type: String
    },
    u_photo: { //当前用头像
        type: String
    },
    u_like: { //点赞
        type: Number,
        default: 0
    },
    u_collect: { //收藏
        type: Number,
        default: 0
    },
    content: { //当前发表内容
        type: String
    },
    imgage_beas: { //当前发表图片
        type: String,
        default: "无"
    },
    author: { //作品作者
        type: String,
        default: '未知'
    },
    aut_from: { //作品出自
        type: String,
        default: '未知'
    },
    datetime: { //记录发表时间
        type: Number, //存储一个数字时间戳 默认是当前时间
        default: Date.now()
    }
});
const ArticleModel = mongoose.model('article', ArticleSchmea);
module.exports = ArticleModel